package com.boho.system.action;


             
/**
 * 
 *
 * @File name:  BatchDeleteTSysUserAction.java   批量删除【系统后台用户:T_USER】
 * @Create on:  2010-05-10 11:27:203
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        

            
import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.exception.UserOperationException;
import cn.boho.framework.service.MessageService;

import com.boho.common.Utils;
import com.boho.system.service.PermissionService;
import com.boho.system.service.UserService;


            
        

public class BatchDeleteTSysUserAction extends ActionImp {

	@Override
	protected void doException(ActionContext atx, Exception ex) {
		if (!(ex instanceof UserOperationException)) {
			atx.setErrorContext("BOHO_COMMON_1003", MessageService.getMessage("BOHO_COMMON_1003"),"【系统后台用户】", ex);
		}
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		Object[] obj = atx.getArrayValue("USER_ID");
		Integer[] userID = Utils.ObjArrayToIntArray(obj);
		UserService.batchDeleteUserByPK(atx, userID);
		PermissionService.batchDeleteUserRole(atx, userID);
		PermissionService.batchDeleteUserFunction(atx, userID);
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		return 1;
	}
}
